/*
 * $Id: object-weapon.h 315 2010-03-25 23:57:03Z cmtonkinson@gmail.com $
 *
 * This file is part of the Symphony project <http://code.google.com/p/symphonymud/>
 * Copyright 2005-2010 Chris Tonkinson <cmtonkinson@gmail.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef H_SYMPHONY_OBJECT_WEAPON
#define H_SYMPHONY_OBJECT_WEAPON

#include "dice.h"
#include "mysql.h"
#include "symphony.h"

class ObjWeapon {
  public:
    // constructors
    ObjWeapon( void );
    ObjWeapon( const ObjWeapon& ref );
    ObjWeapon( ROW row );
    ~ObjWeapon( void );

    // constants
    enum Type { Type_Undefined = 0, Type_Axe, Type_Club, Type_Dagger, Type_Flail, Type_Gauntlet, Type_Longsword, Type_Mace, Type_Polearm, Type_Shortsword, Type_Staff, Type_Whip };
    enum Verb {   Verb_Undefined = 0,
    /* bash */    Verb_Bash = 100, Verb_Beating, Verb_Crush, Verb_Pound, Verb_Punch, Verb_Slam, Verb_Smash, Verb_Strike, Verb_Thwack,
    /* slash */   Verb_Chop = 200, Verb_Cleave, Verb_Cut, Verb_Hack, Verb_Slash, Verb_Slice,
    /* pierce */  Verb_Pierce = 300, Verb_Prick, Verb_Puncture, Verb_Stab, Verb_Sting, Verb_Thrust,
    /* exotic */  Verb_Wrath = 400 };
    enum Flags { Flag_Undefined = 0, Flag_Burning = A, Flag_Freezing = B, Flag_Sharp = C, Flag_Shocking = D };

    // public accessors
    void          type( const unsigned& type )  { _type = type; }
    unsigned      type( void ) const            { return _type; }
    void          verb( const unsigned& verb )  { _verb = verb; }
    unsigned      verb( void ) const            { return _verb; }
    Dice&         damage( void )                { return _damage; }
    const Dice&   damage( void ) const          { return _damage; }

    // general methods
    const char*   typeToString( void ) const;
    void          stringToType( const std::string& src );
    const char*   verbToString( void ) const;
    void          stringToVerb( const std::string& src );

  private:
    unsigned  _type;
    unsigned  _verb;
    Dice      _damage;
};

#endif // H_SYMPHONY_OBJECT_WEAPON
